package com.bs.sc.mgr.order.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.bs.sc.base.entity.BaseEntity;
import com.bs.sc.front.user.entity.User;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Data
@NoArgsConstructor
@Entity
@Table(name = "confirm_order")
@EqualsAndHashCode(callSuper = true)
public class Order extends BaseEntity {

	@NonNull
	@Column(name = "confirm_order_id", length = 32, unique = true, nullable = false)
	private String orderId;
	@NonNull
	@Column(name = "amount", nullable = false)
	private BigDecimal amount;
	@Column(name = "status", length = 1)
	private int status; // 0：新创建 1:已发货 2：已完成
	private String address;
	private String contacts;
	private String phone;
	@OneToOne
	@JoinColumn(name = "user_id")
	private User user;

}
